import React, { memo, useState } from 'react'
import { Menu } from './ClassifyMenu.style'


function ClassifyMenu(props) {
    const {classifyList,checkedIndex}=props
    const {setcheckedIndex} = props
    return (
        <Menu>
            <div 
                className={'item'+ (checkedIndex==0?' checked':'')}
                onClick={()=>setcheckedIndex(0)}
            >
                为你推荐
            </div>
            {
                classifyList.map((item,index)=>{
                    return (index>0)&&<div
                        key={index}
                        className={'item'+ (checkedIndex==index?' checked':'')}
                        onClick={()=>setcheckedIndex(index)}
                        >{item}</div>
                })
            }
        </Menu>
    )
}

export default memo(ClassifyMenu)
